home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / fractal / kaos.lha / symbollib / diamond.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-11-18  |  882 b   |  25 lines

  1. /*
  2. ### draw a diamond ###
  3. */
  4.  
  5. #include <suntool/sunview.h>
  6.  
  7. diamond(pw,xp,yp,s,color,p_type)
  8. Pixwin *pw;
  9. int xp,yp,s,color,p_type;
  10. {
  11.  
  12.         if(p_type==0){
  13.                 pw_vector(pw,xp-s+1,yp-1,xp,yp-s,PIX_SRC | PIX_COLOR(color),1);
  14.                 pw_vector(pw,xp+1,yp-s+1,xp+s,yp,PIX_SRC | PIX_COLOR(color),1);
  15.                 pw_vector(pw,xp+s-1,yp+1,xp,yp+s,PIX_SRC | PIX_COLOR(color),1);
  16.                 pw_vector(pw,xp-1,yp+s-1,xp-s,yp,PIX_SRC | PIX_COLOR(color),1);
  17.         }
  18.         else {
  19.                 pw_vector(pw,xp-s+1,yp-1,xp,yp-s,(PIX_SRC ^ PIX_DST) | PIX_COLOR(color),1);
  20.                 pw_vector(pw,xp+1,yp-s+1,xp+s,yp,(PIX_SRC ^ PIX_DST) | PIX_COLOR(color),1);
  21.                 pw_vector(pw,xp+s-1,yp+1,xp,yp+s,(PIX_SRC ^ PIX_DST) | PIX_COLOR(color),1);
  22.                 pw_vector(pw,xp-1,yp+s-1,xp-s,yp,(PIX_SRC ^ PIX_DST) | PIX_COLOR(color),1);
  23.         }
  24. }
  25.